home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / lists / src / remove.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.3 KB  |  71 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id: remove.c 1.1 1995/11/05 22:49:09 digulla Exp digulla $
  4.     $Log: remove.c $
  5.  * Revision 1.1  1995/11/05  22:49:09  digulla
  6.  * Initial revision
  7.  *
  8.     Desc:
  9.     Lang: english
  10. */
  11. #include "exec_intern.h"
  12.  
  13. /*****************************************************************************
  14.  
  15.     NAME */
  16.     #include <exec/lists.h>
  17.     #include <clib/exec_protos.h>
  18.  
  19.     __AROS_LH1I(void, Remove,
  20.  
  21. /*  SYNOPSIS */
  22.     __AROS_LA(struct Node *, node, A1),
  23.  
  24. /*  LOCATION */
  25.     struct SysBase *, SysBase, 42, Exec)
  26.  
  27. /*  FUNCTION
  28.     Remove a node from a list.
  29.  
  30.     INPUTS
  31.     node - This node to be removed.
  32.  
  33.     RESULT
  34.  
  35.     NOTES
  36.     There is no need to specify the list but the node must be in
  37.     a list !
  38.  
  39.     EXAMPLE
  40.     struct Node * node;
  41.  
  42.     // Remove node
  43.     Remove (node);
  44.  
  45.     BUGS
  46.  
  47.     SEE ALSO
  48.  
  49.     INTERNALS
  50.  
  51.     HISTORY
  52.     26-08-95    digulla created after EXEC-Routine
  53.     26-10-95    digulla adjusted to new calling scheme
  54.  
  55. ******************************************************************************/
  56. {
  57.     assert (node);
  58.     /*
  59.     Unfortunately, there is no (quick) check that the node
  60.     is in a list.
  61.     */
  62.  
  63.     /*
  64.     Just bend the pointers around the node, ie. we make our
  65.     predecessor point to out successor and vice versa
  66.     */
  67.     node->ln_Pred->ln_Succ = node->ln_Succ;
  68.     node->ln_Succ->ln_Pred = node->ln_Pred;
  69. } /* Remove */
  70.  
  71.